<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>电竞社交平台 - 陪玩服务</title>
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/static/CSS/accompany/accompany.css">


</head>

<script>
    const BASE_URL = "${pageContext.request.contextPath}";
    const userName1="${user1.userName}";
    const userId1=${user1.userId};
    const email1='${user1.email}';

    console.log(userName1)
    console.log(userId1)
    console.log(email1)
</script>

<body>
<div class="container">
    <header>
        <div class="logo">
            <i class="fas fa-gamepad"></i>
            <span>电竞陪玩社</span>
        </div>
        <div class="tagline">寻找你的专属游戏伙伴，提升游戏体验</div>

        <!-- 添加服务按钮 -->
        <button id="add-service-btn" class="btn btn-primary">
            <i class="fas fa-plus"></i> 添加服务
        </button>

        <!-- 添加我的陪玩按钮 -->
        <a href="${pageContext.request.contextPath}/my-accompany?email=${user1.email}" class="btn btn-primary">
            <i class="fas fa-user"></i> 我的陪玩
        </a>


    </header>

    <a href="${pageContext.request.contextPath}/User/home?email=${user1.email}" class="btn btn-primary">
        <i class="back home"></i>  返回主页
    </a>

    <!-- 筛选区域 -->
    <section class="filter-section">
        <h2 class="filter-title"><i class="fas fa-filter"></i> 筛选陪玩服务</h2>
        <div class="filter-grid">
            <div class="filter-group">
                <label for="game-type">游戏类型</label>
                <select id="game-type">
                    <option value="">全部游戏</option>
                    <option value="王者荣耀">王者荣耀</option>
                    <option value="和平精英">和平精英</option>
                    <option value="LOL">LOL</option>
                    <option value="原神">原神</option>
                    <option value="DOTA2">DOTA2</option>
                    <option value="CSGO">CSGO</option>
                </select>
            </div>

            <div class="filter-group">
                <label for="service-type">陪玩类型</label>
                <select id="service-type">
                    <option value="">全部类型</option>
                    <option value="上分">上分陪玩</option>
                    <option value="教学">教学陪玩</option>
                    <option value="娱乐">娱乐陪玩</option>
                    <option value="代练">代练服务</option>
                </select>
            </div>

            <div class="filter-group">
                <label for="min-price">最低价格</label>
                <input type="number" id="min-price" placeholder="￥0">
            </div>

            <div class="filter-group">
                <label for="max-price">最高价格</label>
                <input type="number" id="max-price" placeholder="￥500">
            </div>

            <div class="filter-group">
                <label for="keyword">关键词搜索</label>
                <input type="text" id="keyword" placeholder="输入陪玩描述">
            </div>
        </div>

        <div class="filter-buttons">
            <button id="apply-filter" class="btn btn-primary">
                <i class="fas fa-search"></i> 应用筛选
            </button>
            <button id="reset-filter" class="btn btn-outline">
                <i class="fas fa-sync-alt"></i> 重置条件
            </button>
        </div>
    </section>

    <!-- 陪玩服务网格 -->
    <section class="services-grid" id="services-container">
        <!-- 卡片将通过JavaScript动态生成 -->
    </section>
</div>

<!-- 陪玩详情模态框 -->
<div class="modal" id="service-modal">
    <div class="modal-content">
        <span class="close-modal" id="close-modal">&times;</span>

        <div class="modal-header">
            <h2 class="modal-title" id="modal-title">顶级王者陪玩 - 专业上分</h2>
            <div class="modal-price" id="modal-price">￥68.00 <span class="price-unit">/小时</span></div>
        </div>

        <div class="modal-body">
            <div class="modal-image">
                <img id="modal-image" src="" alt="陪玩展示">
            </div>

            <div class="modal-details">
                <div class="detail-item">
                    <div class="detail-label">游戏类型</div>
                    <div class="detail-value" id="modal-game-type">MOBA</div>
                </div>

                <div class="detail-item">
                    <div class="detail-label">服务类型</div>
                    <div class="detail-value" id="modal-service-type">上分陪玩</div>
                </div>

                <div class="detail-item">
                    <div class="detail-label">服务描述</div>
                    <div class="detail-value" id="modal-description">
                        王者荣耀专业陪玩，多个赛季王者，主玩打野和射手位置。
                        擅长教学沟通，耐心指导，可提供游戏内战术分析和技巧教学。
                        无论你是新手还是想提升段位，我都能提供最适合你的陪玩服务。
                    </div>
                </div>

                <div class="detail-item">
                    <div class="detail-label">联系方式</div>
                    <div class="detail-value" id="modal-contact">游戏ID：王者陪玩007</div>
                </div>

                <div class="detail-item">
                    <div class="detail-label">语音介绍</div>
                    <div class="modal-voice">
                        <div class="voice-player">
                            <div class="play-btn">
                                <i class="fas fa-play"></i>
                            </div>
                            <div class="voice-info">
                                <div>我的陪玩介绍</div>
                                <p>点击播放按钮收听语音介绍</p>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>

        <div class="modal-actions">
            <button class="btn btn-primary" >
                <i class="fas fa-comment-alt"></i> 立即联系
            </button>
        </div>
    </div>
</div>

<!-- 添加服务模态框 -->
<div class="modal" id="add-service-modal">
    <div class="modal-content">
        <span class="close-modal" id="close-add-modal">&times;</span>
        <h2 class="modal-title">添加陪玩服务</h2>

        <form id="add-service-form">
            <div class="form-group">
                <label for="add-game-type">游戏类型</label>
                <select id="add-game-type" required>
                    <option value="">请选择游戏</option>
                    <option value="王者荣耀">王者荣耀</option>
                    <option value="和平精英">和平精英</option>
                    <option value="LOL">LOL</option>
                    <option value="原神">原神</option>
                    <option value="DOTA2">DOTA2</option>
                    <option value="CSGO">CSGO</option>
                </select>
            </div>

            <div class="form-group">
                <label for="add-service-type">陪玩类型</label>
                <select id="add-service-type" required>
                    <option value="">请选择类型</option>
                    <option value="上分">上分陪玩</option>
                    <option value="教学">教学陪玩</option>
                    <option value="娱乐">娱乐陪玩</option>
                    <option value="代练">代练服务</option>
                </select>
            </div>

            <div class="form-group">
                <label for="add-description">服务描述</label>
                <textarea id="add-description" rows="4" required placeholder="详细描述您的服务内容..."></textarea>
            </div>

            <div class="form-group">
                <label for="add-price">价格 (元/小时)</label>
                <input type="number" id="add-price" min="0" step="0.01" required placeholder="例如：68.00">
            </div>

            <div class="form-group">
                <label for="add-contact">联系方式</label>
                <input type="text" id="add-contact" required placeholder="游戏ID或联系方式">
            </div>

            <div class="form-group">
                <label>上传图片 (最多3张)</label>
                <div class="file-upload">
                    <input type="file" id="add-images" accept="image/*" multiple>
                    <div class="file-preview" id="image-preview"></div>
                </div>
            </div>

            <div class="form-group">
                <label>上传语音介绍</label>
                <div class="file-upload">
                    <input type="file" id="add-audio" accept="audio/*">
                    <div class="file-preview" id="audio-preview"></div>
                </div>
            </div>

            <div class="form-actions">
                <button type="submit" class="btn btn-primary">
                    <i class="fas fa-check"></i> 提交服务
                </button>
                <button type="button" id="cancel-add" class="btn btn-outline">
                    <i class="fas fa-times"></i> 取消
                </button>
            </div>
        </form>
    </div>
</div>

<script src="${pageContext.request.contextPath}/static/JS/accompany/accompany.js"></script>
<script src="${pageContext.request.contextPath}/static/JS/accompany/accompany-add.js"></script>
</body>
</html>